﻿#region Imports
using System;
using System.Diagnostics;
using System.Windows.Forms;
using CommonUtilities.Controls;
using CommonUtilities.Enums;
using CommonUtilities.Extensions;
using CommonUtilities.Messages;
#endregion

namespace CommonUtilities.UITest
{
    public partial class frmDirectionButtons : Form
    {
        #region Constructors
        public frmDirectionButtons()
        {
            InitializeComponent();
        }
        #endregion

        #region Events
        private void frmDirectionButtons_Load(object sender, EventArgs e)
        {
            cmbDirections.PopulateComboBoxWithEnum<eButtonDirection>(selection: eButtonDirection.Default);
        }

        private void cmbDirections_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!cmbDirections.SelectedItem.IsNull())
                btnDemo.ButtonDirection = (eButtonDirection)cmbDirections.SelectedItem;
        }

        private void btnDemo_Click(object sender, EventArgs e)
        {
            CUtil_DirectionButtons btnDirection = (CUtil_DirectionButtons)sender;
            MessageBoxUtil.Show(Debugger.IsAttached, btnDirection.ButtonDirection.ToString(), btnDirection.Name);
        }
        #endregion
    }
}
